﻿namespace Arms.Domain
{
    using Arms.Framework.Security;
    using System;

    /// <summary>
    /// Base contract for UnitOfWork.
    /// </summary>
    public interface IUnitOfWork : IDisposable
    {
        /// <summary>
        /// User who is using this unit of work.
        /// </summary>
        IUser User { get; }
        /// <summary>
        /// Save changes.
        /// </summary>
        void Commit();
        /// <summary>
        /// Repository.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        IRepository<T> Repository<T>() where T : Entity;
    }
}
